import { axios } from '@/utils/request'
// 物料、线缆  不良池页面接口

// 列表
export function page(parameter) {
    return axios({
        url: '/emsDefectivePool/page',
        method: 'get',
        params: parameter
    })
}

// 新增
export function add(parameter) {
	return axios({
			url: '/emsDefectivePool/add',
			method: 'post',
			data: parameter
	})
}

// 处理（物料退回）
export function handle(parameter) {
	return axios({
			url: '/emsDefectivePool/handle',
			method: 'post',
			data: parameter
	})
}

// 确认发货、扣款
export function confirmShipment(parameter) {
	return axios({
			url: '/emsDefectivePool/confirmShipment',
			method: 'post',
			data: parameter
	})
}

// // 确认入库
// export function confirmWarehousing(parameter) {
// 	return axios({
// 			url: '/emsDefectivePool/confirmWarehousing',
// 			method: 'post',
// 			data: parameter
// 	})
// }

//不良池 入库记录
export function rkPage(parameter) {
	return axios({
			url: '/emsOrder/page',
			method: 'get',
			params: parameter
	})
}

// 分页查询 新
export function pageNew(data) {
	return axios({
			url: '/emsDefectivePoolRecord/page',
			method: 'post',
			parameter: {
				pageNo: data.pageNo,
				pageSize: data.pageSize,
			},
			data
	})
}
// 新增 新
export function addNew(parameter) {
	return axios({
			url: '/emsDefectivePoolRecord/add',
			method: 'post',
			data: parameter
	})
}
// 详情 新
export function detail(parameter) {
	return axios({
			url: '/emsDefectivePoolRecord/detail',
			method: 'post',
			data: parameter
	})
}
//查询不良池关联物料
export function getMaterialByDefectivePoolId(parameter) {
	return axios({
			url: '/emsDefectivePoolMaterial/page',
			method: 'post',
			data: parameter,
			parameter: {
				pageNo: parameter.pageNo,
				pageSize: parameter.pageSize,
			},
	})
}
//处理
export function handleNew(parameter) {
	return axios({
			url: '/emsDefectivePoolRecord/handle',
			method: 'post',
			data: parameter
	})
}

//物料不良池_财务审核
export function caiwuAudit(parameter) {
	return axios({
			url: '/emsDefectivePoolRecord/caiwuAudit',
			method: 'post',
			data: parameter
	})
}
//物料不良池_驳回待处理
export function rejectHandle(parameter) {
	return axios({
			url: '/emsDefectivePoolRecord/rejectHandle',
			method: 'post',
			data: parameter
	})
}


//补发
export function reissue(parameter) {
	return axios({
			url: '/emsDefectivePoolRecord/reissue',
			method: 'post',
			data: parameter
	})
}
//入库
export function confirmWarehousing(parameter) {
	return axios({
			url: '/emsDefectivePoolRecord/confirmWarehousing',
			method: 'post',
			data: parameter
	})
}
//补发记录明细
export function emsDefectivePoolReissueMaterial(data) {
	return axios({
			url: '/emsDefectivePoolReissueMaterial/page',
			method: 'post',
			parameter: {
				pageNo: data.pageNo,
				pageSize: data.pageSize,
			},
			data
	})
}
//分页补发记录
export function emsDefectivePoolReissueRecord(data) {
	return axios({
			url: '/emsDefectivePoolReissueRecord/page',
			method: 'post',
			parameter: {
				pageNo: data.pageNo,
				pageSize: data.pageSize,
			},
			data
	})
}
//扣款
export function deduction(parameter) {
	return axios({
			url: '/emsDefectivePoolRecord/deduction',
			method: 'post',
			data: parameter
	})
}
